﻿using System;
using System.Collections.Generic;
using System.Text;
using IService.DataDLL;
using IService.Model;
using IService.Data;
using System.Data;

namespace IService.Business.Manager
{
	public class AdminManager
	{
		public DTVAdmin GetUserById(int Id)
		{
			DTVAdmin admin = new DTVAdmin();
			admin.ID = Id;
			return DTVData.AdminManager.GetUserById(admin);
		}

		public DataTable GetUserListPagin(PagingEntity pe)
		{
			return DTVData.AdminManager.GetUserListPagin(typeof(DTVAdmin), pe);
		}

		public bool InsertUser(DTVAdmin admin)
		{
			return DTVData.AdminManager.InsertUser(admin);
		}

		public bool UpdateUser(DTVAdmin admin)
		{
			return DTVData.AdminManager.UpdateUser(admin);
		}

		public bool DeleteUser(int Id)
		{
			DTVAdmin admin = new DTVAdmin();
			admin.ID = Id;
			return DTVData.AdminManager.DeleteUser(admin);
		}

		public bool DeleteUserByIds(string Ids)
		{
			string WhereClause = "Id in(" + Ids + ")";
			return DTVData.AdminManager.DeleteUserByIds(typeof(DTVAdmin), WhereClause);
		}

		public DTVAdmin Login(string username, string userpass)
		{
			return DTVData.AdminManager.Login(username, userpass);
		}

		public DTVAdmin LoginByParam(string username, string userpass)
		{
			return DTVData.AdminManager.LoginByParam(username, userpass);
		}
	}
}
